#include<iostream>
using namespace std;
int arr[30][30];
int main()
{
	int n;e
	while (cin >> n && n)
	{
		for (int i = 0; i < n; i++)
		{
			arr[0][0] = 1;
			arr[i][0] = 1;
			arr[i][i] = 1;
		}
		for (int i = 2; i < n; i++)
		{
			for (int j = 1; j < n; j++)
			{
				arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
			}
		}
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j <= i; j++)
			{
				if (i != j) {
					cout << arr[i][j] << " ";
				}
				else
				{
					cout << arr[i][j];
				}
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}